// Copyright (C) Microsoft Corporation. All rights reserved.

using System;
using System.Collections.Generic;
using System.Text;
using System.IO;

namespace Microsoft.VSPowerToys.VSCmdShell
{

    /// <summary>
    /// Any shell to be hosted under VSCmdShell must implement this interface in order for ShellTextBox to interact
    /// with the shell.
    /// </summary>
    public interface IShellHost : IDisposable
    {

        #region Properties

        /// <summary>
        /// A descriptive name for the shell.
        /// </summary>
        string ShellName
        {
            get;
        }

        /// <summary>
        /// Character to be used to escape Visual Studio commands.
        /// </summary>
        char VisualStudioCommandEscapeCharacter
        {
            get;
        }

        #endregion

        /// <summary>
        /// Executes a command on the shell. Command string will be provided to shell as it is
        /// </summary>
        /// <param name="command">Command to execute</param>
        void ExecuteCommand(string command);

        /// <summary>
        /// Allows shell to expand environment variables before command is processed.
        /// This will be used when executing internal Visual Studio commands
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        string ExpandEnvironmentVariables(string input);
        
        /// <summary>
        /// This method is called when ShellTextBox creates the host instance for the first time. 
        /// </summary>
        /// <param name="startingDirectory">Preferred directory to start in.</param>
        /// <remarks>This method will only be called once at the beginning.</remarks>
        void InitializeShellProcess(IShellUI ui, string startingDirectory);

        /// <summary>
        /// Gets the current working directory of the user.
        /// </summary>
        /// <param name="currentLine"></param>
        /// <returns></returns>
        string GetCurrentWorkingDirectory(string currentLine);
    }
}
